<style scoped>
.wraper {
    padding: 0 30px;
}

.search {
    padding-bottom: 20px;
}

.search span {
    color: #68777c;
    font-weight: bold;
    padding-right: 18px;
}

.search button {
    background-color: #00a8f7;
    color: #fff;
    margin-left: 8px;
}

.top {
    margin-bottom: 20px;
    border-top: 1px dashed #cccccc;
}

.detail {
    border-top: 1px dashed #cccccc;
}

.wraper .headline {
    position: relative;
    font-size: 12px;
    color: #303134;
    font-weight: bold;
    margin: 10px 0;
    line-height: 32px;
    height: 32px;
}

.wraper .add-agent {
    position: absolute;
    top: 0px;
    right: 30px;
    background-color: #348bf2;
    color: #fff;
}

.iconfont {
    font-size: 14px;
}

.red-font {
    color: #ff1f1f;
}

/* 分页 start */

.page {
    margin: 20px 0;
}
.ivu-page {
    padding-bottom: 150px;
} 

/* 分页 end */

.fixed-bottom{
    padding-left: 20px;
    padding-right: 20px;
    height: 80px;
    line-height: normal !important;
    position: fixed;
    left: 210px;
    right: 0;
    bottom: 0;
    z-index: 999;
    text-align: center;
    background-color: rgb(255, 255, 255);
    box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.28);
}
.sidehide{
    left: 75px;
}


</style>
<style>
.noborder label.ivu-form-item-label{
    border: none;
    background:transparent;
}
</style>

<template>
    <div class="employee-manage">
        <product-title></product-title>
        <div class="wraper">
            <div class="detail">
                <div class="headline">
                    
                </div>
                <div class="clearfix">
                    <div class="table-theme highlight_table">
                        <Table  ref="currentRowTable" size="large"  stripe highlight-row border :columns="columns_rank" :data="data_rank"></Table>
                    </div>
                </div>
            </div>
        </div>    
    </div>
</template>

<script>
import productTitle from '../../components/productTitle'
import {  getRankList } from '../../api/rank'
export default {
    data() {
        return {
            tableloading:true,
            columns_rank: [
                {
                    type: 'index',
                    title:'序号',
                    width: 60,
                    align: 'center'
                },
                {
                    title: '职级名称',
                    key: 'name',
                    align: 'center',
                },
                {
                    title: '职级别称',
                    key: 'aname',
                    align: 'center',
                },
                {
                    title: '是否是领导',
                    key: 'leader',
                    align: 'center',
                    render: (h, params) => {
                        return h("div", params.row.leader==1?'是':'否');
                    }
                },
            ],
            data_rank: [

            ],
        }
    },
    components: {
        productTitle
    },
    computed: {

    },
    created() {
        
    },
    mounted () {
        this.getList()
    },
    methods: {
        // 获取职级列表
        getList() {
            this.tableloading = true
            new Promise((resolve, reject) => {
                getRankList().then(response => {
                    this.tableloading = false
                    console.log(response.data);
                    if (response.data.err == 0) {
                        this.data_rank = response.data.data;
                    } else {
                        this.$Message.error(response.data.info);
                    }
                    resolve();
                }).catch(error => {
                    reject(error);
                });
            });
        },    
    }
}
</script>
